test = {}
setmetatable(test, { 
    __index = function(table, key)
      print("test metatable __index")
    end,
    __newindex = function(table, key, value)
      print("test metatable __newindex")
    end,
    __call = function(table,...)
      print("test metatable __call")
    end
})


test1 = {}
setmetatable(test1, test)


test()
test.x = 1
print(test.x)
test1() 
--why test1() can not 

--output
  --test metatable __call
  
  --test metatable __newindex
  
  --test metatable __index
  --nil
  
  --Program completed in 0.88 seconds (pid: 15796).
  --OO/ClassVersion2.lua:48: attempt to call global 'test1' (a table value)